#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 30 18:10:46 2024

@author: liqingsimac
"""
'''
c=-1.17+0.2j
z=c
count=0
while (abs(z)<=2) and (count<1000):
    z=z**2+c
    count=count+1
print(count)

'''

#c=-1.16+0.2j
c=-1.17+0.2j
z=c
x=[]
y=[]
for k in range(100):
    x.append(z.real)
    y.append(z.imag)
    if abs(z)<2:
        print('%d : %5.2f + %5.2f j , norm: %5.2f.' %(k,z.real,z.imag,abs(z)) )
    else:
        break
    z=z**2+c

print(z)

import matplotlib.pyplot as plt
plt.plot(x,y,'.--')
